tryCaptureView

abstract fun tryCaptureView(@NonNull child: @NonNull View, pointerId: Int): Boolean(source)

Called when the user's input indicates that they want to capture the given child view with the pointer indicated by pointerId. The callback should return true if the user is permitted to drag the given view with the indicated pointer.

ViewDragHelper may call this method multiple times for the same view even if the view is already captured; this indicates that a new pointer is trying to take control of the view.

If this method returns true, a call to onViewCaptured will follow if the capture is successful.

Return

true if capture should be allowed, false otherwise

Parameters

child

Child the user is attempting to capture

pointerId

ID of the pointer attempting the capture